<?php
session_start();




include "validator.php";
$validator = new Validator;
?>
<html>
<head>
    <meta charset="UTF-8">
    <title>wizzard 1/4</title>
</head>



<?php
if (isset($_POST ["name"])){
    if(empty($_POST["name"])){
        $report["name"] = "Vyplňte jméno";
    }
    if($validator->validAlfanumeric($_POST["name"])){
        $report["name2"]= "chybné použití znaků.";
    }
    if(empty($report))
    {
        $_SESSION = Array();
        $_SESSION["name"] = $_POST["name"] ;
        ?>
        <meta http-equiv="refresh" content="0;url=http://databaze.fbmi.cvut.cz/suchapa3/bitwa2/cv8/wizzard2.php">
        <?  
    }
    else
    {
        foreach ($report as $r){
            echo $r . "<br>"; }
            ?>
        <meta http-equiv="refresh" content="5;url=http://databaze.fbmi.cvut.cz/suchapa3/bitwa2/cv8/wizzard1.php">
        <?php
    }
}

?>
</html>